<!DOCTYPE html>
<html>
  <head>
    <title>Blog</title>
    <%= csrf_meta_tags %>
    <%= stylesheet_link_tag   'application',  'bootstrap', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'bootstrap', 'data-turbolinks-track': 'reload' %>
  </head>

  <body class="<%= params[:controller] + '-' + params[:action] %>">

  <div class="navbar clearfix">
    <div class="container">
      <a class="navbar-brand" href="/">
        Blog
      </a>
      <ul class="nav left">
        <li><a href="/photos">相册</a></li>
      </ul>
      <ul class="nav right">
        <% if current_user %>
          <li><%= link_to('登出', destroy_user_session_path, :method => :delete) %></li>
          <li><%= link_to('修改密码', edit_registration_path(:user)) %> </li>
        <% else %>
          <li><%= link_to('注册', new_registration_path(:user)) %>  </li>
          <li><%= link_to('登陆', new_session_path(:user)) %> </li>
        <% end %>
      </ul>
    </div>
  </div>

  <% if flash.notice %>
  <div class="notice"><%= flash.notice %></div>
  <% end %>

  <%= yield %>

  <div class="footer">
    <div class="container">
      footer
    </div>
  </div>
  <script>
    $('.home-banner').anystretch();
    var hideNotice = function(){
     $(".notice").fadeOut("slow");
    }
    setTimeout(hideNotice, 4000);
 </script>
</body>
</html>
